<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>节目单列表面板页</title>
<link href="css/tscss.css" rel="stylesheet" type="text/css" /> 
<link href="css/smsstyle.css" rel="stylesheet" type="text/css" />
<link href="css/bmasdo2.css" rel="stylesheet" type="text/css" />

<script src="js/list.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
</head>
<script>
var hour = parseFloat("13");
var minu = parseFloat("22");
var seco = parseFloat("44");

//格式化输出服务器时间
function getSeverTime() {
	seco++;
	if (seco == 60) {
		minu += 1;
		seco = 0;
	}
	if (minu == 60) {
		hour += 1;
		minu = 0;
	}
	if (hour == 24) {
		hour = 0;
	}
	sseco = addZero(seco);
	sminu = addZero(minu);
	shour = addZero(hour);
	
	innerdata = "当前服务器时间：";
	document.getElementById("servertime").innerHTML = innerdata +  shour + ":" + sminu + ":" + sseco + "&nbsp;&nbsp;";
	setTimeout("getSeverTime()", 1000);
}

function addZero(num) {
	num = Math.floor(num);
	return ((num <= 9) ? ("0" + num) : num);
}

  function doModify(id){
  	document.forms[0].periodId.value = id;
  	document.forms[0].action = "/makeplaylist/program.do?preform=selforadd";
  	document.forms[0].submit();
  }
  function doDelete(id){
  	if(confirm("确定要删除该时段吗？")){
	  	document.forms[0].periodId.value = id;
	  	document.forms[0].action = "/makeplaylist/program.do?preform=del";
	  	document.forms[0].submit();  
  	}
  }
  function doView(id){
  	document.forms[0].periodId.value = id;
  	document.forms[0].action = "/makeplaylist/program.do?preform=viewprograms";
  	document.forms[0].submit();  	
  }
  function changeLayout(obj){
  	document.forms[0].action = "/makeplaylist/program.do?preform=select";
  	document.forms[0].submit();
  }  
  
  function changePlayDay(){
  	document.forms[0].playlistId.value = "";
   	document.forms[0].action = "/makeplaylist/program.do?preform=select";
  	document.forms[0].submit();
  }
  
  function publishone(){
  	if(confirm("确定要生效当前节目单吗？")){
	  	document.getElementById("bt1").value="生效中，请稍后...";
	  	document.getElementById("bt1").disabled = true;
	  
	   	document.forms[0].action = "/makeplaylist/program.do?preform=publishone";
	  	document.forms[0].submit();
  	}
  }
  
  function add(){
  	document.forms[0].periodId.value = "";
  	document.forms[0].action = "vchannel_program_edit.jsp?preform=selforadd";
  	document.forms[0].submit();
  }  
  function init(){
     if(document.getElementById("bt1") != null && document.getElementById("bt1") != "undefined" && document.getElementById("bt1").disabled == true){
     	document.getElementById("bt1").value="即时生效";
     	document.getElementById("bt1").disabled = false;
     }
  }
  function exitToList(){
  	document.forms[0].action = "/makeplaylist/playlist.do?preform=select";
  	document.forms[0].submit();
  }
  function showValue(obj){
	var oldday = "2018-08-02";
	if(oldday != obj){
	  	document.forms[0].playlistId.value = "";
	   	document.forms[0].action = "/makeplaylist/program.do?preform=select";
	  	document.forms[0].submit();
	}
  }
  
  /* 模板列表页 */
  function modelManage(){
  		document.forms[0].action = "vchannel_program_template_list.jsp?preform=select";
  		document.forms[0].submit();
  		//window.open("/makeplaylist/playlist.do?preform=select&channel_id=935136a1-a427-4ea3-9611-ea83a76bfdc0",'mywin1','height=500,toolbar=no,menubar=no,resizable=no, scrollbars=yes, location=no, status=no');
  }
</script>
<body onload="init();getSeverTime()">
<form action="" method="post">
<input type="hidden" name="layoutModelId" value="9d8c01a1-6a72-4439-ac68-2f47b68a2aa0">
<input type="hidden" name="playlistId" value="3ff772fa-3c9a-46be-b7d4-be90a8f222e5">
<input type="hidden" name="periodId" value="">
<input type="hidden" name="layoutId" value="d2b0c49a-1702-4464-a75c-089d79d673d1">
<input type="hidden" name="channel_id" value="935136a1-a427-4ea3-9611-ea83a76bfdc0">
<input type="hidden" name="from" value="">


<table width="99%" border="0" cellspacing="0" cellpadding="3" align="center" class="tablex">
   <tr>
    <td colspan="5" height="25" valign="middle" align="center" class="OperateTitle" bgcolor="#DEDFDE">节目列表</td>
   </tr>
   <tr>
   <td colspan="5" id="servertime" style="text-align:right;font-weight:bold"></td>
   </tr>
   <tr>
   
   <td height="30" colspan="3" style="font-size:12px;background-color:#dcedff;text-align:left;" >
          &nbsp;&nbsp;播出日期：<input size="10" type="text" name="playDay" value="2018-08-02" onpropertychange="showValue(this.value)" readonly>
          <img onClick="WdatePicker({el:$dp.$('playDay')})"	src="images/dateIcon.gif"> 
    </td>
    
    
     
    
    	<td style="text-align:right"><input id="bt1" type="button" value="即时生效" onClick="publishone()" class="xbuton2">&nbsp;</td>
    
    
    <td height="30" align="right" style="background-color:#dcedff;text-align:right;">
	    <input type="button" value="节目编制" onClick="add()" class="xbuton2">&nbsp;
	    
	    	<input type="button" value="模版" onClick="modelManage()" class="xbuton2">
	    
	    
    </td>
  </tr>

      <tr>
      	 <th align="center" style="width:20%">时段名称</th>
         <th align="center" style="width:15%">开播时间</th>
         <th align="center" style="width:15%">停播时间</th>
         <th align="center" style="width:30%">素材名称</th>
	     <th align="center" style="width:20%">操 &nbsp;&nbsp;作</th>         
	 </tr>
	 
				     <tr >
				     	 <td   align="center" rowspan="2">宣传片</td>
				         <td   align="center" rowspan="2">00:00:00</td>
				         <td   align="center" rowspan="2">23:59:59</td>
				         <td   align="center">夏喻</td>
				         <td   align="center" rowspan="2">
						 	<a href="javascript:doModify('a93082d2-7458-45e0-b801-1c7075a89261')">修改</a>&nbsp;
						 	<a href="javascript:doDelete('a93082d2-7458-45e0-b801-1c7075a89261')">删除</a>	&nbsp;
						 	<a href="javascript:doView('a93082d2-7458-45e0-b801-1c7075a89261')">预览</a>	
						 </td>
					 </tr>
			 
		
				     <tr >
				         <td  align="center">钟诚</td>
					 </tr>
		 
</table>
</form>
</body>
<script language="javascript">

</script>
</html>